﻿using Dapper.FluentMap.Mapping;
using System.ComponentModel.DataAnnotations.Schema;

namespace DapperFluentMap.Entity;

public class ImageInfoView
{
    /// <summary>
    /// 图像扫描id
    /// </summary>
    //[Column("image_id")]
    public int ImageId { get; set; }

    /// <summary>
    /// 设备id
    /// </summary>
    //[Column("device_id")]
    public string DeviceId { get; set; }

    /// <summary>
    /// 图像prn
    /// </summary>
    //[Column("prn")]
    public string Prn { get; set; }

    /// <summary>
    /// 扫描模式：0-unknown，1-标准，2-快速，3-标定，4-自诊断，5- ，6-性能检验（检验），7-性能检验（标定）
    /// </summary>
    //[Column("scan_mode")]
    //public ScanTypeEnum ScanMode { get; set; }

    /// <summary>
    /// 箱体类型：-1-unknown，0-高箱，1-长箱，2-中箱，3-低箱
    /// </summary>
    //[Column("cargo_type")]
    //public emCargoType CargoType { get; set; }

    /// <summary>
    /// 扫描开始时间
    /// </summary>
    //[Column("scan_start_time")]
    public DateTime? ScanStartTime { get; set; }

    /// <summary>
    /// 扫描结束时间
    /// </summary>
    //[Column("scan_end_time")]
    public DateTime? ScanEndTime { get; set; }

    /// <summary>
    /// 扫描员id
    /// </summary>
    //[Column("scan_user_id")]
    public int ScanUserId { get; set; }

    /// <summary>
    /// 0:未知; 1：自动保存；2：手动保存；3：待保存
    /// </summary>
    [Column("is_manual_saving")]
    //public ManualSaveEnum IsManualSaving { get; set; }

    /// <summary>
    /// 0：未锁定；1：锁定
    /// </summary>
    //[Column("is_lock")]
    public int IsLock { get; set; }

    /// <summary>
    /// 是否重建：0：否；1：是
    /// </summary>
    //[Column("is_rcc")]
    public int IsRcc { get; set; }

    /// <summary>
    /// 是否存储：0：否；1：是
    /// </summary>
    //[Column("is_rcs")]
    public int IsRcs { get; set; }

    /// <summary>
    /// 是否识别：0：否；1：是
    /// </summary>
    //[Column("is_rcg")]
    public int IsRcg { get; set; }

    /// <summary>
    /// 原始数据存储状态：0-未完成 1-已完成
    /// </summary>
    //[Column("ori_data")]
    //public StoreCompleteTypeEnum OriData { get; set; }

    /// <summary>
    /// 重建数据存储状态：0-未完成 1-已完成
    /// </summary>
    //[Column("rcc_data")]
    //public StoreCompleteTypeEnum RccData { get; set; }

    /// <summary>
    /// 识别数据存储状态：0-未完成 1-已完成
    /// </summary>
    //[Column("rcg_data")]
    //public StoreCompleteTypeEnum RcgData { get; set; }

    /// <summary>
    /// 图像地址
    /// </summary>
    //[Column("image_path")]
    public string ImagePath { get; set; }

    /// <summary>
    /// 预检单号
    /// </summary>
    //[Column("pre_document_no")]
    public string PreDocumentNos { get; set; }

    /// <summary>
    /// 集装器号
    /// </summary>
    //[Column("plant_box_no")]
    public string PlantBoxNo { get; set; }

    /// <summary>
    /// 航班号
    /// </summary>
    //[Column("flight_no")]
    public string FlightNo { get; set; }

    /// <summary>
    /// 运单号
    /// </summary>
    //[Column("main_awb_no")]
    public string MainAwbNos { get; set; }

    /// <summary>
    /// 装板件数
    /// </summary>
    //[Column("uld_pieces_total")]
    public int? UldPiecesTotal { get; set; }

    /// <summary>
    /// 装板重量
    /// </summary>
    //[Column("uld_weight_total")]
    public float? UldWeightTotal { get; set; }

    /// <summary>
    /// 是否布控：0-未布控；1-已布控
    /// </summary>
    //[Column("is_distributed")]
    public int IsDistributed { get; set; }

    /// <summary>
    /// 布控信息
    /// </summary>
    //[Column("distributed_info")]
    public string DistributedInfo { get; set; }

    /// <summary>
    /// 图像标签
    /// </summary>
    //[Column("image_bind_label")]
    public string ImageBindLabel { get; set; }

    /// <summary>
    /// 判图主键id
    /// </summary>
    //[Column("judge_id")]
    public long JudgeId { get; set; }

    /// <summary>
    /// 判图模式，0-unknown，1-自动判图，2-手动判图
    /// </summary>
    //[Column("judge_mode")]
    //public JudgeModeEnum JudgeMode { get; set; }

    /// <summary>
    /// 判图员用户id
    /// </summary>
    //[Column("judge_user_id")]
    public int? JudgeUserId { get; set; }

    /// <summary>
    /// 判图开始时间
    /// </summary>
    //[Column("judge_start_time")]
    public DateTime? JudgeStartTime { get; set; }

    /// <summary>
    /// 判图结束时间
    /// </summary>
    //[Column("judge_end_time")]
    public DateTime? JudgeEndTime { get; set; }

    /// <summary>
    /// 开检员用户id
    /// </summary>
    //[Column("check_user_id")]
    public int? CheckUserId { get; set; }

    /// <summary>
    /// 开检开始时间
    /// </summary>
    //[Column("check_start_time")]
    public DateTime? CheckStartTime { get; set; }

    /// <summary>
    /// 开检结束时间
    /// </summary>
    //[Column("check_end_time")]
    public DateTime? CheckEndTime { get; set; }

    /// <summary>
    /// 确认员用户id
    /// </summary>
    //[Column("confirm_user_id")]
    public int? ConfirmUserId { get; set; }

    /// <summary>
    /// 确认开始时间
    /// </summary>
    //[Column("confirm_start_time")]
    public DateTime? ConfirmStartTime { get; set; }

    /// <summary>
    /// 确认结束时间
    /// </summary>
    //[Column("confirm_end_time")]
    public DateTime? ConfirmEndTime { get; set; }

    /// <summary>
    /// 自动识别开始时间
    /// </summary>
    //[Column("rcg_start_time")]
    public DateTime? RcgStartTime { get; set; }

    /// <summary>
    /// 自动识别结束时间
    /// </summary>
    //[Column("rcg_end_time")]

    public DateTime? RcgEndTime { get; set; }

    /// <summary>
    /// 自动识别结论，-1-unknown，0-安全，1-嫌疑，2-超时自动，3-高危，4-放行，5-驳回
    /// </summary>
    //[Column("rcg_conclusion_id")]
    //public emConclusion RcgConclusionId { get; set; }

    /// <summary>
    /// 包裹最终结论，-1-unknown，0-安全，1-嫌疑，2-超时自动，3-高危，4-放行，5-驳回
    /// </summary>
    //[Column("final_conclusion_id")]
    //public emConclusion? FinalConclusionId { get; set; }

    /// <summary>
    /// 图像判图结论id，-1-unknown，0-安全，1-嫌疑，2-超时自动，3-高危，4-放行，5-驳回
    /// </summary>
    //[Column("image_judge_conclusion_id")]
    //public emConclusion ImageJudgeConclusionId { get; set; }

    /// <summary>
    /// 开检结论id，-1-unknown，0-安全，1-嫌疑，2-超时自动，3-高危，4-放行，5-驳回
    /// </summary>
    //[Column("image_check_conclusion_id")]
    //public emConclusion ImageCheckConclusionId { get; set; }

    /// <summary>
    /// 确认站结论id，-1-unknown，0-安全，1-嫌疑，2-超时自动，3-高危，4-放行，5-驳回
    /// </summary>
    //[Column("image_confirm_conclusion_id")]
    //public emConclusion ImageConfirmConclusionId { get; set; }

    #region 嫌疑物结论

    ///// <summary>
    ///// 嫌疑物id
    ///// </summary>
    //[Column("suspect_id")]
    //public int SuspectId { get; set; }

    ///// <summary>
    ///// 嫌疑物编号
    ///// </summary>
    //[Column("label")]
    //public int Label { get; set; }

    ///// <summary>
    ///// 嫌疑物类型id
    ///// </summary>
    //[Column("type")]
    //public int Type { get; set; }

    ///// <summary>
    ///// 0-自动标记，1-手动标记
    ///// </summary>
    //[Column("mark_type")]
    //public int MarkType { get; set; }

    ///// <summary>
    ///// 嫌疑物判图结论：0-安全，1-嫌疑，2-超时，3-高危，4-确认，5-驳回，目前只用0和1
    ///// </summary>
    //[Column("suspect_judge_conclusion_id")]
    //public int SuspectJudgeConclusionId { get; set; }

    ///// <summary>
    ///// 嫌疑物开检结论：1-放行，2-拒运，3-移交，4-未开检
    ///// </summary>
    //[Column("suspect_check_conclusion_id")]
    //public int SuspectCheckConclusionId { get; set; }

    ///// <summary>
    ///// 嫌疑物判图结论：1-接受，2-拒绝，3-未审核，4-手动提交
    ///// </summary>
    //[Column("suspect_confirm_conclusion_id")]
    //public int SuspectConfirmConclusionId { get; set; }

    #endregion
}

public class ImageScanInfoEntityClassMapper : EntityMap<ImageInfoView>
{
    public ImageScanInfoEntityClassMapper()
    {
        Map(o => o.ImageId).ToColumn("image_id");
        Map(o => o.DeviceId).ToColumn("device_id");
        Map(o => o.Prn).ToColumn("prn");
        //Map(o => o.ScanMode).ToColumn("scan_mode");
        //Map(o => o.CargoType).ToColumn("cargo_type");
        Map(o => o.ScanStartTime).ToColumn("scan_start_time");
        Map(o => o.ScanEndTime).ToColumn("scan_end_time");
        Map(o => o.ScanUserId).ToColumn("scan_user_id");
        //Map(o => o.IsManualSaving).ToColumn("is_manual_saving");
        Map(o => o.IsLock).ToColumn("is_lock");
        Map(o => o.IsRcc).ToColumn("is_rcc");
        Map(o => o.IsRcs).ToColumn("is_rcs");
        Map(o => o.IsRcg).ToColumn("is_rcg");
        //Map(o => o.OriData).ToColumn("ori_data");
        //Map(o => o.RccData).ToColumn("rcc_data");
        //Map(o => o.RcgData).ToColumn("rcg_data");
        Map(o => o.ImagePath).ToColumn("image_path");
        Map(o => o.PreDocumentNos).ToColumn("pre_document_no");
        Map(o => o.PlantBoxNo).ToColumn("plant_box_no");
        Map(o => o.FlightNo).ToColumn("flight_no");
        Map(o => o.MainAwbNos).ToColumn("main_awb_no");
        Map(o => o.UldPiecesTotal).ToColumn("uld_pieces_total");
        Map(o => o.UldWeightTotal).ToColumn("uld_weight_total");
        Map(o => o.IsDistributed).ToColumn("is_distributed");
        Map(o => o.DistributedInfo).ToColumn("distributed_info");
        Map(o => o.ImageBindLabel).ToColumn("image_bind_label");
        Map(o => o.JudgeId).ToColumn("judge_id");
        //Map(o => o.JudgeMode).ToColumn("judge_mode");
        Map(o => o.JudgeUserId).ToColumn("judge_user_id");
        Map(o => o.JudgeStartTime).ToColumn("judge_start_time");
        Map(o => o.JudgeEndTime).ToColumn("judge_end_time");
        Map(o => o.CheckUserId).ToColumn("check_user_id");
        Map(o => o.CheckStartTime).ToColumn("check_start_time");
        Map(o => o.CheckEndTime).ToColumn("check_end_time");
        Map(o => o.ConfirmUserId).ToColumn("confirm_user_id");
        Map(o => o.ConfirmStartTime).ToColumn("confirm_start_time");
        Map(o => o.ConfirmEndTime).ToColumn("confirm_end_time");
        Map(o => o.RcgStartTime).ToColumn("rcg_start_time");
        Map(o => o.RcgEndTime).ToColumn("rcg_end_time");
        //Map(o => o.RcgConclusionId).ToColumn("rcg_conclusion_id");
        //Map(o => o.FinalConclusionId).ToColumn("final_conclusion_id");
        //Map(o => o.ImageJudgeConclusionId).ToColumn("image_judge_conclusion_id");
        //Map(o => o.ImageCheckConclusionId).ToColumn("image_check_conclusion_id");
        //Map(o => o.ImageConfirmConclusionId).ToColumn("image_confirm_conclusion_id");
        //AutoMap();
    }
}
